<?php

/**
 * Created by PhpStorm.
 * User: yf
 * Date: 2018/3/3
 * Time: 下午6:48
 */
namespace App\Model\Message;

use EasySwoole\Core\Component\Spl\SplBean;

class MessageBean extends SplBean {
	const ADD_FRIEND_TYPE = 1;
	const ADD_FRIEND_PASS_TYPE = 2;
	const ADD_FRIEND_REFUSE_TYPE = 3;
	const FRIEND_CHAT_TYPE = 4;
	const WORLD_CHAT_TYPE = 5;
	const FRIEND_ONLINE_TYPE = 6;
	const FRIEND_OUTLINE_TYPE = 7;
	const OUTLINE_NUM_TYPE = 8;
	protected $id;
	protected $type;
	protected $content;
	protected $uid;
	protected $addtime;
	protected $other;
	protected $fromid;
	
	/**
	 *
	 * @return the $id
	 */
	public function getId() {
		return $this->id;
	}
	
	/**
	 *
	 * @return the $type
	 */
	public function getType() {
		return $this->type;
	}
	
	/**
	 *
	 * @return the $content
	 */
	public function getContent() {
		return $this->content;
	}
	
	/**
	 *
	 * @return the $uid
	 */
	public function getUid() {
		return $this->uid;
	}
	
	/**
	 *
	 * @return the $addtime
	 */
	public function getAddtime() {
		return $this->addtime;
	}
	
	/**
	 *
	 * @return the $other
	 */
	public function getOther() {
		return $this->other;
	}
	
	/**
	 *
	 * @return the $fromid
	 */
	public function getFromid() {
		return $this->fromid;
	}
	
	/**
	 *
	 * @param field_type $id        	
	 */
	public function setId($id) {
		$this->id = $id;
	}
	
	/**
	 *
	 * @param field_type $type        	
	 */
	public function setType($type) {
		$this->type = $type;
	}
	
	/**
	 *
	 * @param field_type $content        	
	 */
	public function setContent($content) {
		$this->content = $content;
	}
	
	/**
	 *
	 * @param field_type $uid        	
	 */
	public function setUid($uid) {
		$this->uid = $uid;
	}
	
	/**
	 *
	 * @param field_type $addtime        	
	 */
	public function setAddtime($addtime) {
		$this->addtime = $addtime;
	}
	
	/**
	 *
	 * @param field_type $other        	
	 */
	public function setOther($other) {
		$this->other = $other;
	}
	
	/**
	 *
	 * @param field_type $fromid        	
	 */
	public function setFromid($fromid) {
		$this->fromid = $fromid;
	}
	function objToArray(bool $is_filter_empty): array {
		if ($is_filter_empty) {
			return $this->toArray ( null, SplBean::FILTER_NOT_EMPTY );
		} else {
			return $this->toArray ();
		}
	}
	protected function initialize(): void {
		// 默认md5是32 位，当从数据库中读出数据恢复为bean的时候，不对密码做md5
	}
}